package exam.demo22;

import java.util.Scanner;

// 70%
public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str1 = in.next();
        String str2 = in.next();
        int len1 = str1.length();
        int len2 = str2.length();
        String s1 = str2.substring(0, len1);
        String s2 = str2.substring(len2 - len1, len2);
        int len = Math.min(size(str1, s1, len1), size(str1, s2, len1));
        System.out.println(len);
    }

    public static int size(String s1, String s2, int len) {
        int count = 0;
        for(int i = 0; i < len; i++) {
            if(s1.charAt(i) != s2.charAt(i)) {
                count++;
            }
        }
        return count;
    }
}
